{% load static %}

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="{% static 'css/user_list.css' %}" />
    <title>Document</title>
  </head>
  <body>
    <h1 class="red">用户列表</h1>
    {% comment %} for循环 {% endcomment %}
    <ul>
      {% for item in params1 %}
      <li>角色：{{item.role}} --- 姓名：{{item.name}}</li>

      <li>
        {% for k,v in item.items %}
        <span>{{k}}={{v}}</span>
        {% endfor %}
      </li>

      <li>
        key值： {% for key in item.keys %}
        <span>{{key}};</span>
        {% endfor %}
      </li>

      <li>
        value值： {% for value in item.values %}
        <span>{{value}};</span>
        {% endfor %}
      </li>
      {% endfor %}
    </ul>

    <hr />
    {{params1.0.role}} = {{params1.0.name}} <br />
    {{params1.1.role}} = {{params1.1.name}}

    <hr />
    <h1>条件语句</h1>
    {% if params1.0.role == '管理员' %}
    <p>管理员</p>

    {% elif params1.0.role == '用户1' %}
    <p>用户1</p>

    {% else %}
    <p>未知角色</p>

    {% endif %}


  </body>
</html>
